package main

import (
	"encoding/json"
	"fmt"
	"gitee.com/tietang/terrace-go/v2/lib/tollgate/dog"
	"github.com/shirou/gopsutil/v3/disk"
	"github.com/shirou/gopsutil/v3/host"
)

func main() {

	//info1()

	info, err := host.Info()
	data, err := json.Marshal(info)
	fmt.Println(string(data), err)
}

func info1() {
	p, e := disk.Usage("/")
	data, e := json.Marshal(p)
	fmt.Println(string(data), e)

	c := &dog.ClientConfig{
		Domain:           "",
		Port:             "3009",
		LogInterval:      10000,
		PollInterval:     1000,
		Debug:            false,
		LogHostInfo:      true,
		LogCPUInfo:       true,
		LogTotalCPUTimes: true,
		LogPerCPUTimes:   true,
		LogMemory:        true,
		LogGoMemory:      true,
	}
	dog := &dog.Dog{
		Config: c,
	}
	dog.HttpWatch()
	dog.Watch()
}
